package org.qydjk.common.pojo;

import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;

import static javax.persistence.GenerationType.IDENTITY;

@Entity
@Table(name = "qy_user_store_card_detail", schema = "qydjk", catalog = "")
public class UserStoreCardDetail {
    private Integer id;
    private Integer userId;
    private Integer storeCardConsumeDetailId;
    private String code;
    private Integer storeCardCategoryId;
    private BigDecimal preVal;
    private BigDecimal val;
    private BigDecimal aftVal;
    private Integer type;
    private Integer sellerId;
    private String sellerName;
    private Integer productId;
    private String productName;
    private Date createTime;
    private Date updateTime;
    private Integer status;

    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "id")
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    @Basic
    @Column(name = "user_id")
    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    @Basic
    @Column(name = "store_card_consume_detail_id")
    public Integer getStoreCardConsumeDetailId() {
        return storeCardConsumeDetailId;
    }

    public void setStoreCardConsumeDetailId(Integer storeCardConsumeDetailId) {
        this.storeCardConsumeDetailId = storeCardConsumeDetailId;
    }

    @Basic
    @Column(name = "code")
    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    @Basic
    @Column(name = "store_card_category_id")
    public Integer getStoreCardCategoryId() {
        return storeCardCategoryId;
    }

    public void setStoreCardCategoryId(Integer storeCardCategoryId) {
        this.storeCardCategoryId = storeCardCategoryId;
    }

    @Basic
    @Column(name = "pre_val")
    public BigDecimal getPreVal() {
        return preVal;
    }

    public void setPreVal(BigDecimal preVal) {
        this.preVal = preVal;
    }

    @Basic
    @Column(name = "val")
    public BigDecimal getVal() {
        return val;
    }

    public void setVal(BigDecimal val) {
        this.val = val;
    }

    @Basic
    @Column(name = "aft_val")
    public BigDecimal getAftVal() {
        return aftVal;
    }

    public void setAftVal(BigDecimal aftVal) {
        this.aftVal = aftVal;
    }

    @Basic
    @Column(name = "type")
    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    @Basic
    @Column(name = "seller_id")
    public Integer getSellerId() {
        return sellerId;
    }

    public void setSellerId(Integer sellerId) {
        this.sellerId = sellerId;
    }

    @Basic
    @Column(name = "seller_name")
    public String getSellerName() {
        return sellerName;
    }

    public void setSellerName(String sellerName) {
        this.sellerName = sellerName;
    }

    @Basic
    @Column(name = "product_id")
    public Integer getProductId() {
        return productId;
    }

    public void setProductId(Integer productId) {
        this.productId = productId;
    }

    @Basic
    @Column(name = "product_name")
    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    @Basic
    @Column(name = "create_time")
    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @Basic
    @Column(name = "update_time")
    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    @Basic
    @Column(name = "status")
    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        UserStoreCardDetail that = (UserStoreCardDetail) o;

        if (id != null ? !id.equals(that.id) : that.id != null) return false;
        if (userId != null ? !userId.equals(that.userId) : that.userId != null) return false;
        if (storeCardConsumeDetailId != null ? !storeCardConsumeDetailId.equals(that.storeCardConsumeDetailId) : that.storeCardConsumeDetailId != null)
            return false;
        if (code != null ? !code.equals(that.code) : that.code != null) return false;
        if (storeCardCategoryId != null ? !storeCardCategoryId.equals(that.storeCardCategoryId) : that.storeCardCategoryId != null)
            return false;
        if (preVal != null ? !preVal.equals(that.preVal) : that.preVal != null) return false;
        if (val != null ? !val.equals(that.val) : that.val != null) return false;
        if (aftVal != null ? !aftVal.equals(that.aftVal) : that.aftVal != null) return false;
        if (type != null ? !type.equals(that.type) : that.type != null) return false;
        if (sellerId != null ? !sellerId.equals(that.sellerId) : that.sellerId != null) return false;
        if (sellerName != null ? !sellerName.equals(that.sellerName) : that.sellerName != null) return false;
        if (productId != null ? !productId.equals(that.productId) : that.productId != null) return false;
        if (productName != null ? !productName.equals(that.productName) : that.productName != null) return false;
        if (createTime != null ? !createTime.equals(that.createTime) : that.createTime != null) return false;
        if (updateTime != null ? !updateTime.equals(that.updateTime) : that.updateTime != null) return false;
        if (status != null ? !status.equals(that.status) : that.status != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id != null ? id.hashCode() : 0;
        result = 31 * result + (userId != null ? userId.hashCode() : 0);
        result = 31 * result + (storeCardConsumeDetailId != null ? storeCardConsumeDetailId.hashCode() : 0);
        result = 31 * result + (code != null ? code.hashCode() : 0);
        result = 31 * result + (storeCardCategoryId != null ? storeCardCategoryId.hashCode() : 0);
        result = 31 * result + (preVal != null ? preVal.hashCode() : 0);
        result = 31 * result + (val != null ? val.hashCode() : 0);
        result = 31 * result + (aftVal != null ? aftVal.hashCode() : 0);
        result = 31 * result + (type != null ? type.hashCode() : 0);
        result = 31 * result + (sellerId != null ? sellerId.hashCode() : 0);
        result = 31 * result + (sellerName != null ? sellerName.hashCode() : 0);
        result = 31 * result + (productId != null ? productId.hashCode() : 0);
        result = 31 * result + (productName != null ? productName.hashCode() : 0);
        result = 31 * result + (createTime != null ? createTime.hashCode() : 0);
        result = 31 * result + (updateTime != null ? updateTime.hashCode() : 0);
        result = 31 * result + (status != null ? status.hashCode() : 0);
        return result;
    }
}
